package com.ruoyi.Information.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.Information.mapper.CommunityFinanceMapper;
import com.ruoyi.Information.domain.CommunityFinance;
import com.ruoyi.Information.service.ICommunityFinanceService;

/**
 * 社区财务流水Service业务层处理
 * 
 * @author xianyu
 * @date 2025-04-04
 */
@Service
public class CommunityFinanceServiceImpl implements ICommunityFinanceService 
{
    @Autowired
    private CommunityFinanceMapper communityFinanceMapper;

    /**
     * 查询社区财务流水
     * 
     * @param id 社区财务流水主键
     * @return 社区财务流水
     */
    @Override
    public CommunityFinance selectCommunityFinanceById(Long id)
    {
        return communityFinanceMapper.selectCommunityFinanceById(id);
    }

    /**
     * 查询社区财务流水列表
     * 
     * @param communityFinance 社区财务流水
     * @return 社区财务流水
     */
    @Override
    public List<CommunityFinance> selectCommunityFinanceList(CommunityFinance communityFinance)
    {
        return communityFinanceMapper.selectCommunityFinanceList(communityFinance);
    }

    /**
     * 新增社区财务流水
     * 
     * @param communityFinance 社区财务流水
     * @return 结果
     */
    @Override
    public int insertCommunityFinance(CommunityFinance communityFinance)
    {
        communityFinance.setCreateTime(DateUtils.getNowDate());
        return communityFinanceMapper.insertCommunityFinance(communityFinance);
    }

    /**
     * 修改社区财务流水
     * 
     * @param communityFinance 社区财务流水
     * @return 结果
     */
    @Override
    public int updateCommunityFinance(CommunityFinance communityFinance)
    {
        return communityFinanceMapper.updateCommunityFinance(communityFinance);
    }

    /**
     * 批量删除社区财务流水
     * 
     * @param ids 需要删除的社区财务流水主键
     * @return 结果
     */
    @Override
    public int deleteCommunityFinanceByIds(Long[] ids)
    {
        return communityFinanceMapper.deleteCommunityFinanceByIds(ids);
    }

    /**
     * 删除社区财务流水信息
     * 
     * @param id 社区财务流水主键
     * @return 结果
     */
    @Override
    public int deleteCommunityFinanceById(Long id)
    {
        return communityFinanceMapper.deleteCommunityFinanceById(id);
    }
}
